package com.example.computer_exam_training_sys.service.impl;

import com.example.computer_exam_training_sys.entity.UserFollow;
import com.example.computer_exam_training_sys.mapper.UserFollowMapper;
import com.example.computer_exam_training_sys.service.UserFollowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserFollowServiceImpl implements UserFollowService {

    @Autowired
    private UserFollowMapper mapper;

    // 添加关注
    @Override
    public int insert(UserFollow userFollow) {
        return mapper.insert(userFollow);
    }

    // 查询某个用户的关注列表
    @Override
    public List<UserFollow> selectByUserId(Integer userId) {
        return mapper.selectByUserId(userId);
    }

    // 取消关注
    @Override
    public int delete(Integer userId, Integer followedUserId) {
        return mapper.delete(userId, followedUserId);
    }
    @Override
    public List<UserFollow> selectAll() {
        return mapper.selectAll();
    }

}
